package com.bwie.controller;

import com.bwie.pojo.TbBrand;
import com.bwie.service.TbBrandService;
import com.bwie.utils.Result;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @projectName: server-2211a-shop
 * @package: com.bwie.controller
 * @className: IndexController
 * @author: 杨珂
 * @description: TODO
 * @date: 2025/5/23 13:45
 * @version: 1.0
 */
@RestController
@RequestMapping("/shop/index")
public class IndexController {


    @Autowired
    TbBrandService tbBrandService;

    /**
     * @param pageInfoVo:
     * @return Result
     * @author :杨珂
     * @description 分页获取品牌列表
     * @date 2025/5/23 13:58
     */
    @PostMapping("/getBrandList")
    public Result getBrandList(@RequestBody PageInfoVo pageInfoVo) {
        return tbBrandService.getBrandList(pageInfoVo);
    }
    /**
     * @param tbBrand:
     * @return Result
     * @author :杨珂
     * @description 添加品牌
     * @date 2025/5/23 13:58
     */
    @PostMapping("/addBrand")
    public Result addBrand(@RequestBody TbBrand tbBrand) {
        return tbBrandService.addBrand(tbBrand);
    }

    @PostMapping("/checkBrandStatus")
    public Result checkBrandStatus(@RequestBody TbBrand tbBrand) {
        return tbBrandService.checkBrandStatus(tbBrand);
    }
}
